<?php
/**
 * Bean holding information about an uploaded file
 */
class UploadedFile {
	private $strName;
	private $strLocation;
	private $strContentType;
	private $intSize;
	
	/**
	 * Sets uploaded file name.
	 * 
	 * @param string $strName
	 * @return void
	 */
	public function setName($strName) {
		$this->strName = $strName;
	}
	
	/**
	 * Gets uploaded file name.
	 * 
	 * @return string
	 */
	public function getName() {
		return $this->strName;
	}
	
	/**
	 * Sets location for the file uploaded.
	 * 
	 * @param string $strLocation
	 * @return void
	 */
	public function setLocation($strLocation) {
		$this->strLocation = $strLocation;
	}
		
	/**
	 * Gets location for the file uploaded
	 * 
	 * @param string $strLocation
	 * @return void
	 */
	public function getLocation() {
		return $this->strLocation;
	}
	
	/**
	 * Sets file mime type.
	 * 
	 * @param string $strContentType
	 * @return void
	 */
	public function setContentType($strContentType) {
		$this->strName = $strContentType;
	}
		
	/**
	 * Gets file mime type.
	 * 
	 * @return string
	 */
	public function getContentType() {
		return $this->strContentType;
	}

	/**
	 * Sets file size.
	 * 
	 * @param integer $intSize
	 * @return void
	 */
	public function setSize($intSize) {
		$this->intSize = $intSize;
	}	
		
	/**
	 * Gets file size.
	 * 
	 * @return int
	 */
	public function getSize() {
		return $this->intSize;
	}
	
	/**
	 * Moves uploaded file to destination.
	 * 
	 * @param string $strDestination
	 * @return boolean
	 */
	public function move($strDestination) {
		return move_uploaded_file($this->strLocation, $strDestination);
	}
	
	/**
	 * Deletes uploaded file.
	 * 
	 * @return boolean
	 */
	public function delete() {
		return unlink($this->strLocation);
	}
}